﻿using System;
using System.Configuration;
using System.Linq;
using Controllers;

namespace Web
{
    public partial class TrainNeedsInfo : System.Web.UI.Page
    {
        protected TrainNeed trainNeed;
        protected string empName;
        protected void Page_Load(object sender, EventArgs e)
        {
            ApolloOaDataContext ctx = new ApolloOaDataContext(ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString);
            string formNo = Request.QueryString["formNo"];
            trainNeed = ctx.TrainNeeds.Single(r => r.FormNo == formNo);
            empName = ctx.Employees.Single(r => r.Id == trainNeed.EmpId).Name;
        }
    }
}